Optimal. Leaf size=122 \[ \frac {1}{8} \left (3 a^2-30 a b+35 b^2\right ) x-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {\left (a^2-10 a b+13 b^2\right ) \tan (e+f x)}{4 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3744, 474, 466,
1167, 209} \begin {gather*} -\frac {\left (a^2-10 a b+13 b^2\right ) \tan (e+f x)}{4 f}+\frac {1}{8} x \left (3 a^2-30 a b+35 b^2\right )+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}-\frac {(a-9 b) (a-b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 466
Rule 474
Rule 1167
Rule 3744
Rubi steps
\begin {align*} \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {x^4 \left (a+b x^2\right )^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}-\frac {\text {Subst}\left (\int \frac {x^4 \left (a^2-10 a b+5 b^2-4 b^2 x^2\right )}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {\text {Subst}\left (\int \frac {(a-9 b) (a-b)-2 (a-9 b) (a-b) x^2+8 b^2 x^4}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {\text {Subst}\left (\int \left (-2 \left (a^2-10 a b+13 b^2\right )+8 b^2 x^2+\frac {3 a^2-30 a b+35 b^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {\left (a^2-10 a b+13 b^2\right ) \tan (e+f x)}{4 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}+\frac {\left (3 a^2-30 a b+35 b^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac {1}{8} \left (3 a^2-30 a b+35 b^2\right ) x-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {\left (a^2-10 a b+13 b^2\right ) \tan (e+f x)}{4 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.00, size = 96, normalized size = 0.79 \begin {gather*} \frac {12 \left (3 a^2-30 a b+35 b^2\right ) (e+f x)-24 \left (a^2-4 a b+3 b^2\right ) \sin (2 (e+f x))+3 (a-b)^2 \sin (4 (e+f x))+32 b \left (6 a-10 b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{96 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 199, normalized size = 1.63
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin ^{9}\left (f x +e \right )}{3 \cos \left (f x +e \right )^{3}}-\frac {2 \left (\sin ^{9}\left (f x +e \right )\right )}{\cos \left (f x +e \right )}-2 \left (\sin ^{7}\left (f x +e \right )+\frac {7 \left (\sin ^{5}\left (f x +e \right )\right )}{6}+\frac {35 \left (\sin ^{3}\left (f x +e \right )\right )}{24}+\frac {35 \sin \left (f x +e \right )}{16}\right ) \cos \left (f x +e \right )+\frac {35 f x}{8}+\frac {35 e}{8}\right )+2 a b \left (\frac {\sin ^{7}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (\sin ^{5}\left (f x +e \right )+\frac {5 \left (\sin ^{3}\left (f x +e \right )\right )}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )-\frac {15 f x}{8}-\frac {15 e}{8}\right )+a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) | \(199\) |
default | \(\frac {b^{2} \left (\frac {\sin ^{9}\left (f x +e \right )}{3 \cos \left (f x +e \right )^{3}}-\frac {2 \left (\sin ^{9}\left (f x +e \right )\right )}{\cos \left (f x +e \right )}-2 \left (\sin ^{7}\left (f x +e \right )+\frac {7 \left (\sin ^{5}\left (f x +e \right )\right )}{6}+\frac {35 \left (\sin ^{3}\left (f x +e \right )\right )}{24}+\frac {35 \sin \left (f x +e \right )}{16}\right ) \cos \left (f x +e \right )+\frac {35 f x}{8}+\frac {35 e}{8}\right )+2 a b \left (\frac {\sin ^{7}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (\sin ^{5}\left (f x +e \right )+\frac {5 \left (\sin ^{3}\left (f x +e \right )\right )}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )-\frac {15 f x}{8}-\frac {15 e}{8}\right )+a^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) | \(199\) |
risch | \(\frac {3 x \,a^{2}}{8}-\frac {15 x a b}{4}+\frac {35 x \,b^{2}}{8}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a^{2}}{8 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a^{2}}{8 f}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} b^{2}}{64 f}-\frac {4 i b \left (-3 a \,{\mathrm e}^{4 i \left (f x +e \right )}+6 b \,{\mathrm e}^{4 i \left (f x +e \right )}-6 a \,{\mathrm e}^{2 i \left (f x +e \right )}+9 b \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a +5 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} a^{2}}{64 f}-\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} a b}{32 f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a b}{2 f}+\frac {i {\mathrm e}^{4 i \left (f x +e \right )} a b}{32 f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a b}{2 f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} b^{2}}{64 f}-\frac {3 i {\mathrm e}^{-2 i \left (f x +e \right )} b^{2}}{8 f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} a^{2}}{64 f}+\frac {3 i {\mathrm e}^{2 i \left (f x +e \right )} b^{2}}{8 f}\) | \(306\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 137, normalized size = 1.12 \begin {gather*} \frac {8 \, b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (3 \, a^{2} - 30 \, a b + 35 \, b^{2}\right )} {\left (f x + e\right )} + 24 \, {\left (2 \, a b - 3 \, b^{2}\right )} \tan \left (f x + e\right ) - \frac {3 \, {\left ({\left (5 \, a^{2} - 18 \, a b + 13 \, b^{2}\right )} \tan \left (f x + e\right )^{3} + {\left (3 \, a^{2} - 14 \, a b + 11 \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.33, size = 126, normalized size = 1.03 \begin {gather*} \frac {3 \, {\left (3 \, a^{2} - 30 \, a b + 35 \, b^{2}\right )} f x \cos \left (f x + e\right )^{3} + {\left (6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{6} - 3 \, {\left (5 \, a^{2} - 18 \, a b + 13 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 16 \, {\left (3 \, a b - 5 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 8 \, b^{2}\right )} \sin \left (f x + e\right )}{24 \, f \cos \left (f x + e\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{4}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 13574 vs.
\(2 (118) = 236\).
time = 18.19, size = 13574, normalized size = 111.26 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.33, size = 128, normalized size = 1.05 \begin {gather*} x\,\left (\frac {3\,a^2}{8}-\frac {15\,a\,b}{4}+\frac {35\,b^2}{8}\right )+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a\,b-3\,b^2\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\left (\frac {5\,a^2}{8}-\frac {9\,a\,b}{4}+\frac {13\,b^2}{8}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {3\,a^2}{8}-\frac {7\,a\,b}{4}+\frac {11\,b^2}{8}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________